<script>
	function add_note(){
		slidetoggle('add_note_ip');
		jQuery("#add_note").focus();
	}
	
</script>
<script language="javascript">
function validate_form(thisform)
{
with (thisform)
{
	
	
	if (validate_required(add_note,"Bạn chưa viết ghi chú !")==false)
 	{add_note.focus();return false;}

}
}
</script>
<?php 
	$user=$_SESSION['userid'];
	$name=$_SESSION['name'];
	$sql2=mysql_query(" select * from 
									tb_task
									inner join tb_account_admin on tb_task.nguoinhan=tb_account_admin.account_id
								where (nguoinhan='$user' or nguoitheodoi like '%$name%' or chuyentiep='$user') and status=1
								order by tb_task.task_id desc
								limit 8
								");
	
?>
 <div id="columns">
        
        <ul id="column1" class="column">
             <li class="widget color-white">  
                <div class="widget-head">
                    <h3 id="duan-dangthuchien"><span><img src="../skins/images/icon-smile.png" /></span>Dự án đang thực hiện</h3>
                </div>
                <div class="widget-content">
                <div class="content-bieudo-cohoi">
              <table width="100%" class="table-colpan" border="1">
  
  <tr align="center" class="tr-css-table-form">
    <td>Tên dự án</td>
    <td>Ưu tiên</td>
    <td>Ngày ĐK/KT</td>
    <td>Người giao</td>
  </tr>
   <?php 
		 	while($row=mysql_fetch_array($sql2))
			{
				
		 ?>
  <tr>
    <td class="td-css-table" onclick="window.open('index.php?tn=task_detail&id=<?php echo $row['task_id'];?>','_blank');" style="cursor:pointer"><?php echo $row['task_name'];?></td>
    <td class="trung-binh-xanh" align="center">
    	<?php if($row['level']==1){echo 'Thấp';}?>
        <?php if($row['level']==2){echo 'Trung bình';}?>
        <?php if($row['level']==3){echo 'Cao';}?>
    </td>
    <td>
    <span class="chus-dk">S:</span> <span class="ngay-dk-xong"> <?php echo date('d-m-y',$row['contract_start']);?></span><br />
   <span class="chus-dk">E:</span> <span class="ngay-dk-xong"><?php echo date('d-m-Y',$row['contract_end']);?></span>
    </td>
    <td class="name-nguoidk" align="center"><?php echo $row['sender'];?></td>
  </tr>
 <?php }?>
</table>

                </div>
                   
                </div>
            </li>
          <li class="widget color-white">  
                <div class="widget-head">
                    <h3 id="duan-dangchodk"><span><img src="../skins/images/icon-smile2.png" /></span>Quản lý hợp đồng</h3>
                </div>
                <div class="widget-content">
                 <div class="content-bieudo-cohoi">
                <table width="100%" class="table-colpan" border="1">
  <tr align="center" class="tr-css-table-form">
    <td>Tên dự án</td>
    <td>Ưu tiên</td>
    <td>Ngày bắt đầu</td>
    <td>Ngày kết thúc</td>
  </tr>
  <tr>
    <td class="td-css-table">Dự án website hady.com.vn</td>
    <td class="trung-binh-xanh">Trung bình</td>
    <td><span class="ngay-dk-xong">20/11/2012</span></td>
    <td class="name-nguoidk"><span class="ngay-dk-xanh">25/11/2012</span></td>
  </tr>
 
</table>
                 </div>
                  
                </div>
            </li>
        </ul>

        <ul id="column2" class="column">
          <li class="widget color-white">  
                <div class="widget-head">
                    <h3 id="Ghichu-nhanh"> <span><img src="../skins/images/icon-smile3.png" /></span> Ghi chú nhanh <a onclick="add_note()" class="add_note">Thêm ghi chú mới
                   
                    </a></h3>
                </div>
                <div class="content-bieudo-cohoi">
                <div id="add_note_ip" style="float:left;width:100%;"> 
                <form action="index.php?tn=add_note" method="post" onsubmit="return validate_form(this);">
        		<input onblur="addNote(false,this.value)"  style="width:75%;" type="text" name="add_note" id="add_note" value="">
                <span><input type="submit" name="submit" value="OK" /> </span>
                </form>
	</div>
			<?php 
				$user=$_SESSION['userid'];
				$sqlnote=mysql_query("select * from notes where user_id='$user' order by notes_id desc");
				while($rsnote=mysql_fetch_array($sqlnote))
				{
			?>
	
               <p class="line-ghichu-x">
               	<strong>
                <a class="cl23" onclick="note_Edit(23)"><?php echo $rsnote['content'];?></a>
                <textarea onblur="save_note(23,this.value)" class="edit23 editnotetxt"></textarea>
                </strong> 
                <span style="cursor:pointer"><a onclick="window.open('index.php?tn=del_note&id=<?php echo $rsnote['notes_id'];?>','_self');"><img src="../skins/images/xxx.png" /></a></span> 
                <span><?php echo date('d-m-Y h:i',$rsnote['time']);?></span> </p>
               
              <?php }?>   
                </div>
            </li>
        
            
            <li class="widget color-white">  
                <div class="widget-head">
                    <h3 id="duan-quahan">Chiến dịch marketing</h3>
                </div>
                <div class="widget-content">
                <div class="content-bieudo-cohoi">
                      <table width="100%" class="table-colpan" border="1">
  <tr align="center" class="tr-css-table-form">
    <td>Tên chiến dịch</td>
    <td>Ưu tiên</td>
    <td>Ngày bắt đầu</td>
    <td>Ngày kết thúc</td>
  </tr>
  <tr>
    <td class="td-css-table">Dự án website hady.com.vn</td>
    <td class="trung-binh-xanh">Trung bình</td>
    <td><p><span class="ngay-dk-xong">20/11/2012</span></p></td>
    <td class="name-nguoidk"><span class="ngay-dk-xong">25/11/2012</span></td>
  </tr>
  
</table>
                   </div>
                </div>
            </li>
        </ul>
  
    </div>
 
 
 <script type="text/javascript" src="http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js"></script>
<script type="text/javascript" src="jquery-ui-personalized-1.6rc2.min.js"></script>
<script type="text/javascript" src="inettuts.js"></script>
<script type="text/javascript" src="js/tooltip.js"></script>
    <!--end contnoidung-->